﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BullsAndCows
{
    public class User
    {
        private string name;
        private int guesses;
        private int cheats;

        public User()
        {
            name = "";
            guesses = 0;
            cheats = 0;
        }

        public string Name
        {
            get
            {
                return name;
            }
            set
            {
                name = value;
            }
        }

        public int Guesses
        {
            get
            {
                return guesses;
            }
            set
            {
                if (value < 0)
                {
                    throw new ArgumentException("Number of guesses cannot be less tha 0!");
                }
                guesses = value;
            }
        }

        public int Cheats
        {
            get
            {
                return cheats;
            }
            set
            {
                if (value < 0)
                {
                    throw new ArgumentException("Number of cheats cannot be less tha 0!");
                }
                cheats = value;
            }
        }

        public bool IsAllowedToScoreBoard()
        {
            return cheats == 0;
        }
    }
}